<!--<?php
print <<<EOT
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
<title>显示地图</title>  
<style type="text/css">
body,div,td,th,input,button,h3,form,p,ul,li,dl,dt,dd{margin:0; padding:0}
body{font-size:12px; font-family:\5b8b\4f53;}
h3{color:#08c; font-size:14px; height:30px; line-height:30px}
.btn-line{margin:20px 0 5px;}
form p{padding:5px 0 5px 50px; min-height:21px; _height:21px; line-height:21px; position:relative}
form p label{position:absolute; top:5px; left:0; width:45px; height:21px; padding-right:5px; text-align:right;}


input,textarea{border:1px solid; border-color:#999999 #e1e1e1 #e1e1e1 #999999; height:19px; padding:0 5px; line-height:19px; width:153px; font-size:12px;}
textarea{padding:0 0 0 5px; width:158px; height:65px;}

span.btn,span.btn span{background:url(mode/house/images/map-btn.png) no-repeat 100% 0}
span.btn{padding:0 2px 0 0;zoom: 1;display: inline-block;vertical-align: middle; cursor: pointer; _display: inline;}
span.btn span{display: block;background-position:0 0;padding:0 4px 0 6px;padding:0 6px 0 8px\9;}
span.btn button{display:block;overflow:visible;height:21px;margin:0 -10px;padding:0 10px; color:#5b5b5b;line-height:20px;width:auto;_width:0;border:0 none;background:none;text-decoration:none;vertical-align:middle;white-space:nowrap;cursor:pointer;}
	
span.btn_l{background-position:100% -21px;}
span.btn_l span{background-position:0 -21px; padding:0 11px 0 13px;padding:0 13px 0 15px\9;}
span.btn_l button{height:27px;margin:0 -16px;padding:0 16px;line-height:27px;font-size:14px;font-weight:700;color:#ffffff;}

#map{width:100%; height:460px;}

.search_result{position:absolute;top: 10px;right: 10px; z-index:999; display: none}
.search_result_content{position:relative; opacity: 0.9; filter:alpha(opacity=90);border:1px solid #76a9dc; padding:22px 3px 5px 14px; width:250px;background: #fff url(mode/house/images/map-result.png) repeat-x 0 100%;}
#close{position:absolute; top:5px; right:12px; width:13px; height:13px; overflow:hidden; text-indent:-99em; background:url(mode/house/images/map-close.png) no-repeat 0 0;}
.search_result ul{list-style:none;height:400px; overflow-y:auto; }
.search_result .item{padding-left:23px; margin-bottom:10px; zoom:1; cursor:pointer; background:url(mode/house/images/map-ico.png) no-repeat -274px 2px; color:#000;}
.search_result .item dl{line-height:18px;}
.search_result .item dt{line-height:20px; font-size:14px; font-weight:bold}
.search_result .current{color:#258ad3; background-position:0 2px;}


.bgcorner1,.bgcorner2,.bgcorner3,.bgcorner4,.pobg1,.pobg2,.pobg3,.pobg4{filter:Alpha(opacity=39);_filter:Alpha(opacity=39);opacity:.39;overflow:hidden;z-index:1005;line-height:0 }
.bgcorner1,.bgcorner2,.bgcorner3,.bgcorner4{width:5px;height:5px;background:#5692ce;}
.pobg1,.pobg2,.pobg3,.pobg4{background:#5692ce;}
.pobg1{height:5px; }
.pobg2{width:5px;}
.pobg3{height:5px;}
.pobg4{width:5px;}
</style>
<script type="text/javascript" src="http://app.mapabc.com/apis?&t=flashmap&v=2.3.2&key={$house_mapkey}"></script>   
<script type="text/javascript" src="mode/house/js/housemap-utility.js"></script>
<script type="text/javascript" src="mode/house/js/housemap.js"></script>
<script type="text/javascript" src="mode/house/js/housemap-keywordsearch.js"></script>
<script type="text/javascript" src="mode/house/js/city_u.js"></script>
<script type="text/javascript">
function mapClose(){
	var _this=document.getElementById("searchResultPane");
	_this.style.display="none";
}
function  showHouseMap(){
	var mapPointObj = new mapPoint();
	mapPointObj.point_x = '$point_x';
	mapPointObj.point_y = '$point_y';
	if(mapPointObj.point_x != null && mapPointObj.point_x != '' && mapPointObj.point_x != 0){
		mapPointObj.pointRotation = 30;
		mapPointObj.mapZoom = '$mapZoom';
		mapPointObj.pointTip = getPointTipContents('$sContent[saletele]','$sContent[aveprice]','$sContent[address]','$hid');
		mapPointObj.pointTitle = htmlDecode('$pointTitle');
		mapPointObj.showTip = true;
	}else{
		//如果没有坐标点信息地图定位到默认城市
		var cityName = Trim($('cityName').value);
		var cityCode = city.ctn2c(cityName);
		var xy = new Array();
		xy = city.ctxy(cityCode);
		mapPointObj.mapZoom = 11;
		mapPointObj.point_x = xy[0];
		mapPointObj.point_y = xy[1];
		mapPointObj.showTip = false;
		mapPointObj.showPointDelay = true;
	}
	mapInit(mapPointObj);
}
var searchPointsTag = 'admin';
function showHouseMapDemo(formObj){
	var mapPointObj = new mapPoint();
	mapPointObj.point_x = formObj.point_x.value;
	mapPointObj.point_y = formObj.point_y.value;
	mapPointObj.mapZoom = formObj.mapZoom.value;
	mapPointObj.pointTip = formObj.mapLaber.value;
	mapPointObj.pointTitle = '$pointTitle';
	mapPointObj.showTip = true;
	changeMap(mapPointObj);
}

function searchHoseByKeywords() {
	var cityName = Trim($('cityName').value); 
	var cityCode = city.ctn2c(cityName);
	var keyword = Trim($('search_keyword').value); 
	if (cityName == null || cityName == '' || cityName == 'undefined') {
		alert("城市不能为空");
		return;
	}
	if (keyword == null || keyword == '' || keyword == 'undefined') {
		var xy = new Array();
		xy = city.ctxy(cityCode);
		mapObj.setZoomAndCenter(11,new MLngLat(xy[0],xy[1]));
		return;
	}
	mapSearcherObj.keyword = keyword;
	mapSearcherObj.cityname = cityName;
	mapSearcherObj.citycode = cityCode
	mapSearcherObj.resultPane = 'search_result_content';
	mapSearcherObj.searchResultCount = 5;
	mapSearcherObj.searchResultShowInner = true;
	mapSearcherObj.searchPointBykeywords();
	var searchResult = document.getElementById('searchResultPane');
	searchResult.style.display = "block";
}

function clearSearchResult () {
	var arr = mapObj.getOverlaysByType(MOverlay.TYPE_MARKER);
	for(var i = 0; i < arr.length; i++){
		var markerObjId = arr[i].id;
		if(markerObjId.match(searchPointsTag)){
			mapObj.removeOverlay(arr[i]);
		}
	}
}

function startTracePoint(value){
	 if (mapObj != null && mapObj != 'undefined' && mapObj != '') {
		 if(value=='add'){
			 mapObj.addEventListener(mapObj,MOUSE_CLICK,clickMouse);
			 document.getElementById('remove').style.display = '';
			 document.getElementById('add').style.display = 'none';
		 }else{
			 mapObj.removeEventListener(mapObj,MOUSE_CLICK,clickMouse);
			 clearPointsByIds(clickPointIds);
			 document.getElementById('remove').style.display = 'none';
			 document.getElementById('add').style.display = '';
		 }
	 }
}
</script>
</head>
<body onload="showHouseMap()">
<table style="z-index: 1; width:100%; *table-layout:fixed"><tbody><tr>
	<td style="vertical-align: top;" width="250">
		<h3>城市搜索</h3>
		<form name="FORM1">
			<p><label for="search_citycode">城&nbsp;&nbsp;市</label><input type="text" name="cityName" value="{$house_mapcity}" id="cityName"/></p>
			<p><label for="search_keyword">关键字</label><input type="text" name="keyword" value="" id="search_keyword"/></p>
			<p><span class="btn" style="margin-right:11px;"><span><button onfocus="blur();" type="button" onclick="searchHoseByKeywords()">搜 索</button></span></span>
				<span class="btn"><span><button onfocus="blur();" type="button" onclick="clearSearchResult()">清除搜索结果</button></span></span>
			</p>
		</form>
		<p class="btn-line"><span class="btn btn_l"><span>
		<button onclick="startTracePoint('add')" onfocus="blur();" value="add" id="add" style="display:">点击开始标注点</button>
		<button onclick="startTracePoint('remove')" onfocus="blur();" value="remove" id="remove" style="display:none">点击关闭标注点</button>
		</span></span></p>
		<br>
		<h3>鼠标点击地图获取坐标:</h3>
		<form action="$basename&action=map&verify=$posthash" method="post" name="FORM2">
			<input type="hidden" value="$hid" name="hid" />
			<input type="hidden" value="2" name="step" />
			<p><label for="point_x">X</label><input type="text" value="$point_x" name="point_x" id="point_x"/></p>
			<p><label for="point_y">Y</label><input type="text" value="$point_y" name="point_y" id="point_y"/></p>
			<p><label for="mapZoom">Zoom</label><input type="text" value="$mapZoom" name="mapZoom" id="mapZoom"/></p>
			<!-- p><label for="mapLaber">Label</label><textarea type="text" value="$pointLaber" name="mapLaber" id="mapLaber">{$pointLaber}</textarea></p -->
			<!-- p><span class="btn"><span><button onfocus="blur();" type="button" onclick="showHouseMapDemo(this.form)">预 览</button></span></span -->
			<p>
			<span class="btn"><span><button onfocus="blur();" type="button" onclick="parent.ajax.submit(this.form)">保 存</button></span></span>
			<span class="btn"><span><button onfocus="blur();" type="reset">重 置</button></span></span>
			</p>
		</form>
	</td>
	<td><div style="position:relative;">
		<div id="map"></div>
		<div id="searchResultPane" class="search_result">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td>
					<div class="search_result_content">
						<ul id="search_result_content">
						</ul>
						<a href="javascript:;" onclick="mapClose()" id="close">关闭</a>
					</div>
				</td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr>
			</table>
		</div>
	</div>
	</td>
</tr></tbody></table>
</body>
</html>
<!--
EOT;
?>-->




